//
//  exp.h
//  LTLBMC
//
//  Created by GD Huang on 5/18/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#ifndef LTLBMC_exp_h
#define LTLBMC_exp_h



#include "typ.h"
#include "unop.h"
#include "binop.h"
#include "lval.h"
#include "astVisitor.h"
#include "OCamlObject.h"

extern "C" {
#include <caml/mlvalues.h>
}

namespace cilast {
    
    class constant;
    class lval;
    class astVisitor;
    
    class exp : public OCamlObject {
    public:
        virtual int accept(astVisitor* visitor);
    };
    
    
    class Const : public exp {
    public:    
        constant* mconstant;
        
        int accept(astVisitor*);
    };
    
    class Lval : public exp {
    public:    
        lval* mlval;
        
        int accept(astVisitor*);
    };
    
    class SizeOf : public exp {
    public:    
        typ* mtyp;
        
        int accept(astVisitor*);
    };
    
    class SizeOfE : public exp {
    public:    
        exp* mexp;
        
        int accept(astVisitor*);
    };
    
    class SizeOfStr : public exp {
    public:    
        char* mstr;
        
        int accept(astVisitor*);
    };
    
    class AlignOf : public exp {
    public:    
        typ* mtyp;    
        
        int accept(astVisitor*);
    };
    
    class AlignOfE : public exp {
    public:    
        exp* mexp;
        
        int accept(astVisitor*);
    };
    
    
    class UnOp : public exp {
    public:    
        unop munop;
        exp* mop1;
        typ* mtyp;
        
        int accept(astVisitor*);
    };
    
    class BinOp : public exp {
    public:    
        binop mbinop;
        exp* mop1;
        exp* mop2;
        typ* mtyp;
        
        int accept(astVisitor*);
    };
    
    class CastE : public exp {
    public:    
        typ* mtyp;
        exp* mexp;
        
        int accept(astVisitor*);
    };
    
    class AddrOf : public exp {
    public:    
        lval* mlval;
        
        int accept(astVisitor*);
    };
    
    class StartOf : public exp {
    public:    
        lval* mlval;
        
        int accept(astVisitor*);
    };
    
}

#endif
